<template>
    <div class="recommend">
        <div class="rec">
            <div class="rec-title">特别推荐</div>
            <div class="rec-list">

                <div class="rec-list-item" >
                    <router-link :to="'/show/'+goods_id">
                        <img class="rec-list-item-img" :src="/^(http|https):\/\//.test(goodsData.goods_image) ? goodsData.goods_image : url+goodsData.goods_image"/>
                    </router-link>
                    <div class="rec-list-item-info">
                        <div class="rec-list-item-tit">
                            <router-link :to="'/show/'+goods_id">{{goodsData.goods_name}}</router-link>
                        </div>
                        <div class="rec-list-item-price">
                            <div><span class="old">销量：{{goodsData.goodssales}}</span></div>
                            <router-link class="query" :to="'/show/'+goods_id">
                                查看详情
                            </router-link>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="comment">
            <div class="comment-leftmark">“</div>
            <div class="comment-text">
                {{commentData.content}}
            </div>
            <div class="comment-rightmark">”</div>
            <div v-if="comment_img.length > 0">
                <div class="comment-pictures" v-for="item in comment_img">
                    <img :src="/^(http|https):\/\//.test(item.src) ? item.src : url+item.src" alt="">
                </div>
            </div>
            
            <div v-else class="comment-pictures">
                <img src="../assets/swiper1.jpg" alt="">
            </div>
        </div>
        <div class="h150"></div>
        <router-link to="/my" class="footer" >
            <div class="footer-tips">
                <div>快帮行- 专业的北美定制游旅行服务</div>
                <div>注册即送新人旅行红包，想去哪浪就去哪浪！</div>
            </div>
            <!-- <div > -->
                <img class="footer-img" src="../assets/receive.png" alt="">
            <!-- </div> -->
        </router-link>
    </div>
</template>

<script>
    import {MessageBox } from 'mint-ui';
    import wxShare from "../store/wxShare"
    import store from "../store/store"
    import config from '../store/config'
    import storage from "../store/localstorage"

    export default {
        name: "recommend",

        data() {
            return {
                url:config.url,
                comment_id:"",
                goods_id:"",
                goodsData:{},
                commentData:{},
                comment_img:[],
            }   
        },
        methods: {
           getevaluateList(){
               let params = {
                   comment_id:this.comment_id
               }
               if(!this.$store.state.token){
                   params.token = 'fasle88888888';
                   params.member_id = 'fasle88888888';
               }
               this.axios.post('/wap/member/getevaluateList',params).then(res=>{
                    this.goodsData = res.data.goods;
                    this.commentData = res.data.comment;
                    this.comment_img = JSON.parse(res.data.comment.comment_img);
                    this.goods_id = res.data.comment.goods_id;
                })
           }
        },
        mounted() {
            this.comment_id = this.$route.query.comment_id;
            this.getevaluateList();
        }

    }
</script>

<style lang="scss" scoped>
    @import "../assets/base";

    .h150 {
        height: rpx(150);
        background: $bgcolor1
    }
    .recommend{
        background: #F3F2F7;
        min-height: 100%;
    }
    .rec {
        // margin: rpx(20);
        padding:rpx(20);
        background: $color0;
        // border-radius: rpx(20);

        &-title {
            padding: rpx(30) 0;
            font-size: rpx(32);
            color: $color3;
        }

        &-list {
            display: flex;
            flex-wrap: wrap;
            border-top: $color2 solid 1px;

            &-item {
                display: flex;
                align-items: center;
                width: 100%;

                &-img {
                    border-radius: rpx(10);
                    margin: rpx(20) 0;
                    width: rpx(128);
                    height: rpx(128);
                }

                &-info {
                    flex: 1;
                }

                &-tit {
                    padding: rpx(20) rpx(20) 0;
                    font-size: rpx(28);
                    line-height: 130%;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical
                }

                &-price {
                    padding: rpx(20);
                    font-size: rpx(30);
                    color: $color3;
                    display: flex;
                    justify-content:space-between;
                    align-items: center;

                    .old {
                        font-size: rpx(24);
                        color: $color5;
                        // text-decoration: line-through;
                    }
                    .query{
                        font-size: rpx(26);
                        padding: rpx(15);
                        color: #ffffff;
                        background: #FA7D33;
                        border-radius: rpx(10);
                    }
                }
            }
        }
    }
    .comment {
        padding: rpx(20);
        &-leftmark{
            font-family: initial;
            font-size: rpx(80);
            color: #C6C6C6;
            height: rpx(30);
        }
        &-rightmark{
            font-family: initial;
            font-size: rpx(80);
            color: #C6C6C6;
            text-align: right;
            height: rpx(30);
        }
        &-text{
            padding: 0 rpx(60);
            line-height: 1.4;
        }
        &-pictures{
            margin: rpx(20) 0;
            border-radius: rpx(10);
            overflow: hidden;
            img{
                width: 100%;
            }
        }
    }
    .footer{
        position: fixed;
        bottom: 0;
        left: 0;
        background: #ffffff;
        width: 100%;
        padding: rpx(10) rpx(20);
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
        &-tips{
            div{
                font-size: rpx(29);
                color: #ED8541;
                line-height: 1.6;
            }
        }
        &-img{
            width: rpx(128);
            height: rpx(128);
            
        }
    }
    //分享
    .share {
        &-div {
            position: fixed;
            background: rgba(0, 0, 0, .5);
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 99999;
            width: 100%;
            height: 100%;
            text-align: center;

            &-img {
                margin-top: rpx(30);
                width: rpx(500);
                height: rpx(220);
            }
        }
    }
</style>

